<?php echo $javascript->link('ad-index',false) ?>
<script>
var baseurl="<?php e(Configure::read('App.baseUrl'))?>";
</script>
 <div id="headbar">
      <ul >
      <li><a href='' id='add'>添加广告</a></li>
      <li><a href='' id='delm'>批量删除</a></li>
      <li>
        显示:
        <select id='timeSearch'>
        <option value='all'>全部</option>
        <option value='passed' <?php if ($timetype=='passed') echo 'selected'?>>过期的</option>
        <option value='current' <?php if ($timetype=='current') echo 'selected'?>>正在进行中的</option>
        <option value='future' <?php if ($timetype=='future') echo 'selected'?>>将要发布的</option>
        </select>
      </li>
      </ul>
 </div>
 <div id='content'>
 <table width="96%" class='list'>
 <tr>
    <th width="5%" class='rowhead'>ID</th><th>广告标题</th><th width="30%">广告主联系方式</th>
    <th width='8%'>位置编码</th>
    <th width="10%">开始时间</th>
    <th width="10%">结束时间</th>
    <th width="15%">操作</th>
 </tr>
<?php
    $baseurl=Configure::read('App.baseUrl');
    $rownum=0;
    foreach($al as $ad){
        if($rownum % 2 == 0)
            e('<tr>');
       else
            e('<tr class="odd">');
          
        $st=$time->format('Y-m-d',$ad['Ad']['startTime']);
        $et=$time->format('Y-m-d',$ad['Ad']['endTime']);
        e("<td class='rowhead'>{$ad['Ad']['id']}</td><td class='leftalign'>{$ad['Ad']['title']}</td>
        <td class='leftalign'>{$ad['Ad']['connectMsg']}</td>
        <td class='leftalign'>{$ad['Ad']['place']}</td>
        <td>$st</td>
        <td>{$et}</td>
        <td><input type='checkbox' value={$ad['Ad']['id']}
        <a href='{$baseurl}admin/ads/edit/{$ad['Ad']['id']}'>编辑</a>
        <a href='{$baseurl}admin/ads/del/{$ad['Ad']['id']}'>删除</a></td>");
        e('</tr>');
        $rownum++;
    }
?>
 </table>
 </div>
              
